import tkinter.messagebox
from tkinter import *
def login():
    if entry1.get() == qq and entry2.get() == password:
        print(1)
        tkinter.messagebox.showinfo('登录信息', '登录成功!!!')
    else:
        print(2)

def reset():
    entry1.delete(0, tkinter.END)
    entry2.delete(0, tkinter.END)
root = Tk()
qq = '2276198772'
password = 'ljtyyds'
width = 400
height = 200
img = PhotoImage(file='login.png')
lb = Label(root, image=img)
#lb.place(x = 0, y = 0, relwidth = 1, relhight = 1)
image_lable = tkinter.Label(root, image=img)
image_lable.grid(row = 0, column = 1)
root.title('模拟QQ登陆页面')
Label(root, text = '       账号:', font = ('',16)).grid(row = 1)
Label(root, text = '       密码:', font = ('',16)).grid(row = 2)
b1 = Button(root, text=' 登录 ', bg = 'lightblue', fg = 'white', command=login)
b2 = Button(root, text=' 重置 ', bg = 'lightblue', fg = 'white', command=reset)
b1.grid(row = 3, column = 0, sticky = 'e')
b2.grid(row = 3, column = 1, sticky = 'e')
entry1 = Entry(root)
entry2 = Entry(root)
entry1.grid(row = 1, column = 1)
entry2.grid(row = 2, column = 1)
root.geometry("{}x{}".format(width, height))
root.mainloop()
